<?php
/**
 * The Footer widget areas
 *
 * @package dkret3
 * @since 3.6
 */

if ( is_active_sidebar( '1st-subsidiary-sidebar' ) || is_active_sidebar( '2nd-subsidiary-sidebar' ) || is_active_sidebar( '3rd-subsidiary-sidebar' ) ) : ?>

    <div id="subsidiary" role="complementary">

        <?php /* dkret3 Hook */ do_action( 'dkret_before_subsidiary' ); ?>

        <?php if ( is_active_sidebar( '1st-subsidiary-sidebar' ) ) : ?>

            <div id="first" class="sidebar sub-sidebar">

                <?php /* dkret3 Hook */ do_action( 'dkret_before_first_subsidiary' ); ?>

                <?php dynamic_sidebar( '1st-subsidiary-sidebar' ); ?>

                <?php /* dkret3 Hook */ do_action( 'dkret_after_first_subsidiary' ); ?>

            </div><!-- #first -->

        <?php endif; ?>

        <?php if ( is_active_sidebar('2nd-subsidiary-sidebar') ) : ?>

            <div id="second" class="sidebar sub-sidebar">

                <?php /* dkret3 Hook */ do_action( 'dkret_before_second_subsidiary' ); ?>
 
                <?php dynamic_sidebar( '2nd-subsidiary-sidebar' ) ?>

                <?php /* dkret3 Hook */ do_action( 'dkret_after_second_subsidiary' ); ?>

            </div><!-- #second -->
            
        <?php endif; ?>

        <?php if ( is_active_sidebar( '3rd-subsidiary-sidebar' ) ) : ?>

            <div id="third" class="sidebar sub-sidebar">

                <?php /* dkret3 Hook */ do_action( 'dkret_before_third_subsidiary' ); ?>

                <?php dynamic_sidebar( '3rd-subsidiary-sidebar' ); ?>

                <?php /* dkret3 Hook */ do_action( 'dkret_after_third_subsidiary' ); ?>

            </div><!-- #third -->

        <?php endif; ?>

        <?php /* dkret3 Hook */ do_action( 'dkret_after_subsidiary' ); ?>

    </div><!-- #subsidiary -->
    
<?php endif; ?>